local hx__tongye_mou = fk.CreateSkill {
  name = "hx__tongye_mou",
}

hx__tongye_mou:addEffect("active", {
  anim_type = "control",
  prompt = "#hx__tongye_mou-active",
  max_phase_use_time = 1,
  can_use = function(self, player)
    return player:getMark("@hx__zhiheng_mou_ye") > 0 and player:hasSkill(hx__tongye_mou.name) and player:usedEffectTimes(hx__tongye_mou.name) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local x = player:getMark("@hx__zhiheng_mou_ye")
    local choices = {}
    for i = 1, x do
      table.insert(choices, tostring(i))
    end
    local choice = room:askToChoice(player, {
      choices = choices,
      skill_name = hx__tongye_mou.name,
      prompt = "请选择消耗的“业”标记数",
      cancelable = false,
    })
    if choice then
      local y = tonumber(choice)
      room:addPlayerMark(player, "@hx__tongye_mou_addEffect-turn", y)
      room:removePlayerMark(player, "@hx__zhiheng_mou_ye", y)
    end
  end,
})


return hx__tongye_mou
